import React,{useEffect} from 'react';
import {BrowserRouter as Router,Route,Routes} from 'react-router-dom';
import JoinRoomPage from './pages/joinRoomPage/JoinRoomPage';
import RoomPage from './pages/roompage/RoomPage';
import IntroductionPage from './pages/introductionPage/IntroductionPage';
import { connectWithSocketIOServer } from './utils/wss';

function App() {
  useEffect(() =>{
    connectWithSocketIOServer();
  },[]);
  return (
   <Router>
    <Routes>
      <Route path='/join-room' element={<JoinRoomPage/>}></Route>
      <Route path='/' element={<IntroductionPage/>}></Route>
      <Route path='/room' element={<RoomPage/>}></Route>
    </Routes>
   </Router>
  );
}

export default App;
